import jieba as jb
import sys

hit_stop_path = "D:\\java\\NLP\\Flink-realtimeProcess\\src\\main\\resources\\script\\hit_stopwords.txt"

def sentenceCut(sentence,stop_path):
    stop_list = [line[:-1] for line in open(stop_path,'r',encoding='UTF-8')]
    sentence = sentence.strip()
    cut_sentence_list = jb.lcut(sentence)
    after_stop_list = []
    for word in cut_sentence_list:
        if word not in stop_list:
            after_stop_list.append(word)
    for w in after_stop_list:
        print(w)

if __name__ == '__main__':
    sentenceCut(sys.argv[1],hit_stop_path)
